import { $get } from '@js/authRequest'
import { message } from 'antd'

// 获取请求内容
export async function getContentRequest (data) {
  const res = await $get('/api/xapc/deliver/getDeliverContent', data)
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}

// 获取鉴定机构列表
export async function getListRequest () {
  const res = await $get('/api/xapc/appraisal', {
    page_size: 100000
  })
  if (res.status !== 1) {
    message.error(res.message)
    throw new Error(res.message)
  }
  return res.data.list.map(li => {
    return {
      id: li.id,
      name: li.name,
      type: li.type,
      contact: li.contact,
      subject_type: '鉴定机构',
      address: li.address
    }
  })
}
